May, 2018, Mauro Alberti, alberti.m65@gmail.com
In [8]:
from pygsf.libs_utils.gdal.gdal import *
Reading an example data
In [9]:
data_path = "/home/mauro/Documents/projects/gsf/pygsf/example_data/vx.asc" # change accordingly
In [10]:
dataset, geotransform, num_bands, projection = read_raster(data_path)
In [11]:
band_params, band_array = read_band(dataset, 1)
In [12]:
print("Geotransform: {}".format(geotransform))
print("Number of bands: {}".format(num_bands))
print("Projection: {}".format(projection))
print("Data type: {}".format(band_params["dataType"]))
print("Unit type: {}".format(band_params["unitType"]))
print("Statistics: {}".format(band_params["stats"]))
print("No data value: {}".format(band_params["noData"]))
print("Number of overviews: {}".format(band_params["numOverviews"]))
print("Number of color table entries: {}".format(band_params["numColorTableEntries"]))